package util.ui;
import javax.swing.JComponent;
import java.util.prefs.Preferences;

/*
 * Created on Jun 16, 2005
 * 
 * An interface for abstracting commandline parameters, mostly for the
 * purpose of having a generic UI system for entry and validation.
 */

/**
 * @author brian
 *
 */
public interface CommandLineParameter 
{
	// Returns a UI widget for editing the parameter.  The widget
	// will be set to it's default value.
	public JComponent getUIWidget ( );
		
	// Returns the option with its value set (e.g. -out filename).  The value
	// is retrieved from the input UI widget 
	public String getOption ( JComponent widget );
	
	// mdb added 3/4/08
	public String getOptionName ( );
	
	// mdb added 3/4/08
	public void setOptionValue( JComponent widget, String value );
	
	// Returns text for labeling the widget
	public String getLabelText ( );
	
	// Returns true/false if the input widget data is valid
	public boolean isDataValid ( JComponent widget );
	
	// Returns an (optional) more descriptive message of why 
	// validation failed.
	public String getDataValidMsg ( JComponent widget );
	
	// Sets the default value for the input UI widget
	public void setWidgetToDefault ( JComponent widget );
	
	// Puts default value into input preferences object
	public void getDefault ( Preferences userPrefs, String strSuffix ); 
	
	// Pass user preferences to/from the widget
	public void setWidgetToUserPref ( Preferences userPrefs, String strSuffix, JComponent widget );
	public void getUserPrefFromWidget ( JComponent widget, Preferences userPrefs, String strSuffix );

};


